package com.linhngua.code.data.people;

import java.util.Collection;
import java.util.HashSet;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;

import com.linhngua.code.data.shop.Shop;

@Entity
public class Owner extends User {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Collection<Shop> ownedShops;
	
	

	public Owner() {
		super();
		ownedShops=new HashSet<Shop>();
		
	}


	public Owner(Collection<Shop> shops) {
		super();
		this.ownedShops = shops;
	}

	@OneToMany(cascade=CascadeType.ALL,mappedBy="owner")
	public Collection<Shop> getOwnedShops() {
		return ownedShops;
	}

	public void setOwnedShops(Collection<Shop> shops) {
		this.ownedShops = shops;
	}
	
	
}
